Imports System.Configuration

Public Class frmGlMain
    Inherits System.Windows.Forms.Form
    Public LogFlag As Integer
    Public ImagePath As String = ConfigurationManager.AppSettings("ImagePath")
    Public MainTitle As String
    Dim AccountForm As Object
    Dim GlgForm As Object
    Dim GltForm As Object
    Dim GlrForm As Object
    Dim GldocForm As Object
    Dim GlbForm As Object
    Dim GlEnqForm As Object
    Dim GlslForm As Object
    Dim GlPLForm As Object
    Dim GlBsForm As Object
    Dim GlSchForm As Object
    Dim GlTbForm As Object
    Dim GLtEnqForm As Object
    Dim GLposForm As Object
    Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
    Friend WithEvents ChartOfAccountsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ChartOfAccountsToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents DocumentsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents BudgetToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents BudgetToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents TransactionToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents TransactionsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ACEnquiryToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents PointOfSaleEnquiryToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents TransactionEnquiryToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents FinancialReportsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents LedgerReportToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents TrialBalanceToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ProfitAndLossStatementToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents BalanceToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents AccountGroupCreateToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ChartOfAccountsCreateToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents CustomerToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents CustomerGroupCreateToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents CustomerGroupViewToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents CustomerMasterCreateToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents QToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ReporToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ARAccountEnquiryToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ARStatementOfAccountToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ARAgeingReportToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ARSubLedgerAccountEnquiryToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents BudgetViewToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents SupplierToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents SupplierGroupToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents SupplierGroupViewToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents CreateSupplierToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents SupplierMasterViewToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ReportsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents APAccountEnquiryToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents APStatementOfAccountToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents APAgeingReportToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents APSubLedgerAccountEnquiryToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ACDocumentsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ACDocumentsCreateToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ACDocumentsViewToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Dim DeptAccForm As Object


#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents ttPosMenu As System.Windows.Forms.ToolTip
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents btnTrfr As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmGlMain))
        Me.ttPosMenu = New System.Windows.Forms.ToolTip(Me.components)
        Me.btnTrfr = New System.Windows.Forms.Button()
        Me.Button4 = New System.Windows.Forms.Button()
        Me.Panel1 = New System.Windows.Forms.Panel()
        Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
        Me.ACDocumentsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ACDocumentsCreateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ACDocumentsViewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ChartOfAccountsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.AccountGroupCreateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.DocumentsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ChartOfAccountsCreateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ChartOfAccountsToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.CustomerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.CustomerGroupCreateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.CustomerGroupViewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.CustomerMasterCreateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.QToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.SupplierToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.SupplierGroupToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.SupplierGroupViewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.CreateSupplierToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.SupplierMasterViewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.BudgetToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.BudgetToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.BudgetViewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.TransactionToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.TransactionsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ACEnquiryToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.PointOfSaleEnquiryToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.TransactionEnquiryToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ReporToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ARAccountEnquiryToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.ARStatementOfAccountToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.ARAgeingReportToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.ARSubLedgerAccountEnquiryToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.ReportsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.APAccountEnquiryToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.APStatementOfAccountToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.APAgeingReportToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.APSubLedgerAccountEnquiryToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.FinancialReportsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.LedgerReportToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.TrialBalanceToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.ProfitAndLossStatementToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.BalanceToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.Panel1.SuspendLayout()
        Me.MenuStrip1.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnTrfr
        '
        Me.btnTrfr.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnTrfr.Image = CType(resources.GetObject("btnTrfr.Image"), System.Drawing.Image)
        Me.btnTrfr.Location = New System.Drawing.Point(244, 46)
        Me.btnTrfr.Name = "btnTrfr"
        Me.btnTrfr.Size = New System.Drawing.Size(28, 24)
        Me.btnTrfr.TabIndex = 69
        Me.ttPosMenu.SetToolTip(Me.btnTrfr, "Transactions - Recurring")
        Me.btnTrfr.Visible = False
        '
        'Button4
        '
        Me.Button4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button4.Image = CType(resources.GetObject("Button4.Image"), System.Drawing.Image)
        Me.Button4.Location = New System.Drawing.Point(360, 60)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(28, 24)
        Me.Button4.TabIndex = 75
        Me.ttPosMenu.SetToolTip(Me.Button4, "Document Types")
        Me.Button4.Visible = False
        '
        'Panel1
        '
        Me.Panel1.BackColor = System.Drawing.Color.SlateGray
        Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Panel1.Controls.Add(Me.btnTrfr)
        Me.Panel1.Controls.Add(Me.Button4)
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.Panel1.Location = New System.Drawing.Point(0, 26)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(1036, 447)
        Me.Panel1.TabIndex = 63
        '
        'MenuStrip1
        '
        Me.MenuStrip1.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ACDocumentsToolStripMenuItem, Me.ChartOfAccountsToolStripMenuItem, Me.CustomerToolStripMenuItem, Me.SupplierToolStripMenuItem, Me.BudgetToolStripMenuItem, Me.TransactionToolStripMenuItem, Me.ReporToolStripMenuItem, Me.ReportsToolStripMenuItem, Me.FinancialReportsToolStripMenuItem})
        Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
        Me.MenuStrip1.Name = "MenuStrip1"
        Me.MenuStrip1.Size = New System.Drawing.Size(1036, 26)
        Me.MenuStrip1.TabIndex = 87
        Me.MenuStrip1.Text = "MenuStrip1"
        '
        'ACDocumentsToolStripMenuItem
        '
        Me.ACDocumentsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ACDocumentsCreateToolStripMenuItem, Me.ACDocumentsViewToolStripMenuItem})
        Me.ACDocumentsToolStripMenuItem.Name = "ACDocumentsToolStripMenuItem"
        Me.ACDocumentsToolStripMenuItem.Size = New System.Drawing.Size(116, 22)
        Me.ACDocumentsToolStripMenuItem.Text = "A/C Documents"
        '
        'ACDocumentsCreateToolStripMenuItem
        '
        Me.ACDocumentsCreateToolStripMenuItem.Name = "ACDocumentsCreateToolStripMenuItem"
        Me.ACDocumentsCreateToolStripMenuItem.Size = New System.Drawing.Size(224, 22)
        Me.ACDocumentsCreateToolStripMenuItem.Text = "A/C Documents - Create"
        '
        'ACDocumentsViewToolStripMenuItem
        '
        Me.ACDocumentsViewToolStripMenuItem.Name = "ACDocumentsViewToolStripMenuItem"
        Me.ACDocumentsViewToolStripMenuItem.Size = New System.Drawing.Size(224, 22)
        Me.ACDocumentsViewToolStripMenuItem.Text = "A/C Documents - View"
        '
        'ChartOfAccountsToolStripMenuItem
        '
        Me.ChartOfAccountsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AccountGroupCreateToolStripMenuItem, Me.DocumentsToolStripMenuItem, Me.ChartOfAccountsCreateToolStripMenuItem, Me.ChartOfAccountsToolStripMenuItem1})
        Me.ChartOfAccountsToolStripMenuItem.Name = "ChartOfAccountsToolStripMenuItem"
        Me.ChartOfAccountsToolStripMenuItem.Size = New System.Drawing.Size(128, 22)
        Me.ChartOfAccountsToolStripMenuItem.Text = "Chart of Accounts"
        '
        'AccountGroupCreateToolStripMenuItem
        '
        Me.AccountGroupCreateToolStripMenuItem.Name = "AccountGroupCreateToolStripMenuItem"
        Me.AccountGroupCreateToolStripMenuItem.Size = New System.Drawing.Size(236, 22)
        Me.AccountGroupCreateToolStripMenuItem.Text = "Account Group - Create"
        '
        'DocumentsToolStripMenuItem
        '
        Me.DocumentsToolStripMenuItem.Name = "DocumentsToolStripMenuItem"
        Me.DocumentsToolStripMenuItem.Size = New System.Drawing.Size(236, 22)
        Me.DocumentsToolStripMenuItem.Text = "Account Group - View"
        '
        'ChartOfAccountsCreateToolStripMenuItem
        '
        Me.ChartOfAccountsCreateToolStripMenuItem.Name = "ChartOfAccountsCreateToolStripMenuItem"
        Me.ChartOfAccountsCreateToolStripMenuItem.Size = New System.Drawing.Size(236, 22)
        Me.ChartOfAccountsCreateToolStripMenuItem.Text = "Chart of Accounts - Create"
        '
        'ChartOfAccountsToolStripMenuItem1
        '
        Me.ChartOfAccountsToolStripMenuItem1.Name = "ChartOfAccountsToolStripMenuItem1"
        Me.ChartOfAccountsToolStripMenuItem1.Size = New System.Drawing.Size(236, 22)
        Me.ChartOfAccountsToolStripMenuItem1.Text = "Chart of Accounts - View"
        '
        'CustomerToolStripMenuItem
        '
        Me.CustomerToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.CustomerGroupCreateToolStripMenuItem, Me.CustomerGroupViewToolStripMenuItem, Me.CustomerMasterCreateToolStripMenuItem, Me.QToolStripMenuItem})
        Me.CustomerToolStripMenuItem.Name = "CustomerToolStripMenuItem"
        Me.CustomerToolStripMenuItem.Size = New System.Drawing.Size(108, 22)
        Me.CustomerToolStripMenuItem.Text = "AR - Customer"
        '
        'CustomerGroupCreateToolStripMenuItem
        '
        Me.CustomerGroupCreateToolStripMenuItem.Name = "CustomerGroupCreateToolStripMenuItem"
        Me.CustomerGroupCreateToolStripMenuItem.Size = New System.Drawing.Size(234, 22)
        Me.CustomerGroupCreateToolStripMenuItem.Text = "Customer Group - Create"
        '
        'CustomerGroupViewToolStripMenuItem
        '
        Me.CustomerGroupViewToolStripMenuItem.Name = "CustomerGroupViewToolStripMenuItem"
        Me.CustomerGroupViewToolStripMenuItem.Size = New System.Drawing.Size(234, 22)
        Me.CustomerGroupViewToolStripMenuItem.Text = "Customer Group - View"
        '
        'CustomerMasterCreateToolStripMenuItem
        '
        Me.CustomerMasterCreateToolStripMenuItem.Name = "CustomerMasterCreateToolStripMenuItem"
        Me.CustomerMasterCreateToolStripMenuItem.Size = New System.Drawing.Size(234, 22)
        Me.CustomerMasterCreateToolStripMenuItem.Text = "Customer Master - Create"
        '
        'QToolStripMenuItem
        '
        Me.QToolStripMenuItem.Name = "QToolStripMenuItem"
        Me.QToolStripMenuItem.Size = New System.Drawing.Size(234, 22)
        Me.QToolStripMenuItem.Text = "Customer Master - View"
        '
        'SupplierToolStripMenuItem
        '
        Me.SupplierToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SupplierGroupToolStripMenuItem, Me.SupplierGroupViewToolStripMenuItem, Me.CreateSupplierToolStripMenuItem, Me.SupplierMasterViewToolStripMenuItem})
        Me.SupplierToolStripMenuItem.Name = "SupplierToolStripMenuItem"
        Me.SupplierToolStripMenuItem.Size = New System.Drawing.Size(151, 22)
        Me.SupplierToolStripMenuItem.Text = "AP - Supplier/Vendor"
        '
        'SupplierGroupToolStripMenuItem
        '
        Me.SupplierGroupToolStripMenuItem.Name = "SupplierGroupToolStripMenuItem"
        Me.SupplierGroupToolStripMenuItem.Size = New System.Drawing.Size(226, 22)
        Me.SupplierGroupToolStripMenuItem.Text = "Supplier Group - Create"
        '
        'SupplierGroupViewToolStripMenuItem
        '
        Me.SupplierGroupViewToolStripMenuItem.Name = "SupplierGroupViewToolStripMenuItem"
        Me.SupplierGroupViewToolStripMenuItem.Size = New System.Drawing.Size(226, 22)
        Me.SupplierGroupViewToolStripMenuItem.Text = "Supplier Group - View"
        '
        'CreateSupplierToolStripMenuItem
        '
        Me.CreateSupplierToolStripMenuItem.Name = "CreateSupplierToolStripMenuItem"
        Me.CreateSupplierToolStripMenuItem.Size = New System.Drawing.Size(226, 22)
        Me.CreateSupplierToolStripMenuItem.Text = "Supplier Master - Create"
        '
        'SupplierMasterViewToolStripMenuItem
        '
        Me.SupplierMasterViewToolStripMenuItem.Name = "SupplierMasterViewToolStripMenuItem"
        Me.SupplierMasterViewToolStripMenuItem.Size = New System.Drawing.Size(226, 22)
        Me.SupplierMasterViewToolStripMenuItem.Text = "Supplier Master - View"
        '
        'BudgetToolStripMenuItem
        '
        Me.BudgetToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BudgetToolStripMenuItem1, Me.BudgetViewToolStripMenuItem})
        Me.BudgetToolStripMenuItem.Name = "BudgetToolStripMenuItem"
        Me.BudgetToolStripMenuItem.Size = New System.Drawing.Size(64, 22)
        Me.BudgetToolStripMenuItem.Text = "Budget"
        '
        'BudgetToolStripMenuItem1
        '
        Me.BudgetToolStripMenuItem1.Name = "BudgetToolStripMenuItem1"
        Me.BudgetToolStripMenuItem1.Size = New System.Drawing.Size(172, 22)
        Me.BudgetToolStripMenuItem1.Text = "Budget - Create"
        '
        'BudgetViewToolStripMenuItem
        '
        Me.BudgetViewToolStripMenuItem.Name = "BudgetViewToolStripMenuItem"
        Me.BudgetViewToolStripMenuItem.Size = New System.Drawing.Size(172, 22)
        Me.BudgetViewToolStripMenuItem.Text = "Budget - View"
        '
        'TransactionToolStripMenuItem
        '
        Me.TransactionToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TransactionsToolStripMenuItem, Me.ACEnquiryToolStripMenuItem, Me.PointOfSaleEnquiryToolStripMenuItem, Me.TransactionEnquiryToolStripMenuItem})
        Me.TransactionToolStripMenuItem.Name = "TransactionToolStripMenuItem"
        Me.TransactionToolStripMenuItem.Size = New System.Drawing.Size(89, 22)
        Me.TransactionToolStripMenuItem.Text = "Transaction"
        '
        'TransactionsToolStripMenuItem
        '
        Me.TransactionsToolStripMenuItem.Name = "TransactionsToolStripMenuItem"
        Me.TransactionsToolStripMenuItem.Size = New System.Drawing.Size(204, 22)
        Me.TransactionsToolStripMenuItem.Text = "Transactions - Create"
        '
        'ACEnquiryToolStripMenuItem
        '
        Me.ACEnquiryToolStripMenuItem.Name = "ACEnquiryToolStripMenuItem"
        Me.ACEnquiryToolStripMenuItem.Size = New System.Drawing.Size(204, 22)
        Me.ACEnquiryToolStripMenuItem.Text = "Account Enquiry"
        '
        'PointOfSaleEnquiryToolStripMenuItem
        '
        Me.PointOfSaleEnquiryToolStripMenuItem.Name = "PointOfSaleEnquiryToolStripMenuItem"
        Me.PointOfSaleEnquiryToolStripMenuItem.Size = New System.Drawing.Size(204, 22)
        Me.PointOfSaleEnquiryToolStripMenuItem.Text = "Point of Sale Enquiry"
        '
        'TransactionEnquiryToolStripMenuItem
        '
        Me.TransactionEnquiryToolStripMenuItem.Name = "TransactionEnquiryToolStripMenuItem"
        Me.TransactionEnquiryToolStripMenuItem.Size = New System.Drawing.Size(204, 22)
        Me.TransactionEnquiryToolStripMenuItem.Text = "Transaction Enquiry"
        '
        'ReporToolStripMenuItem
        '
        Me.ReporToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ARAccountEnquiryToolStripMenuItem1, Me.ARStatementOfAccountToolStripMenuItem1, Me.ARAgeingReportToolStripMenuItem1, Me.ARSubLedgerAccountEnquiryToolStripMenuItem1})
        Me.ReporToolStripMenuItem.Name = "ReporToolStripMenuItem"
        Me.ReporToolStripMenuItem.Size = New System.Drawing.Size(88, 22)
        Me.ReporToolStripMenuItem.Text = "AR Reports"
        '
        'ARAccountEnquiryToolStripMenuItem1
        '
        Me.ARAccountEnquiryToolStripMenuItem1.Name = "ARAccountEnquiryToolStripMenuItem1"
        Me.ARAccountEnquiryToolStripMenuItem1.Size = New System.Drawing.Size(275, 22)
        Me.ARAccountEnquiryToolStripMenuItem1.Text = "AR - Account Enquiry"
        '
        'ARStatementOfAccountToolStripMenuItem1
        '
        Me.ARStatementOfAccountToolStripMenuItem1.Name = "ARStatementOfAccountToolStripMenuItem1"
        Me.ARStatementOfAccountToolStripMenuItem1.Size = New System.Drawing.Size(275, 22)
        Me.ARStatementOfAccountToolStripMenuItem1.Text = "AR - Statement of Account"
        '
        'ARAgeingReportToolStripMenuItem1
        '
        Me.ARAgeingReportToolStripMenuItem1.Name = "ARAgeingReportToolStripMenuItem1"
        Me.ARAgeingReportToolStripMenuItem1.Size = New System.Drawing.Size(275, 22)
        Me.ARAgeingReportToolStripMenuItem1.Text = "AR - Ageing Report"
        '
        'ARSubLedgerAccountEnquiryToolStripMenuItem1
        '
        Me.ARSubLedgerAccountEnquiryToolStripMenuItem1.Name = "ARSubLedgerAccountEnquiryToolStripMenuItem1"
        Me.ARSubLedgerAccountEnquiryToolStripMenuItem1.Size = New System.Drawing.Size(275, 22)
        Me.ARSubLedgerAccountEnquiryToolStripMenuItem1.Text = "AR - Sub Ledger Account Enquiry"
        '
        'ReportsToolStripMenuItem
        '
        Me.ReportsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.APAccountEnquiryToolStripMenuItem, Me.APStatementOfAccountToolStripMenuItem1, Me.APAgeingReportToolStripMenuItem1, Me.APSubLedgerAccountEnquiryToolStripMenuItem1})
        Me.ReportsToolStripMenuItem.Name = "ReportsToolStripMenuItem"
        Me.ReportsToolStripMenuItem.Size = New System.Drawing.Size(96, 22)
        Me.ReportsToolStripMenuItem.Text = "AP - Reports"
        '
        'APAccountEnquiryToolStripMenuItem
        '
        Me.APAccountEnquiryToolStripMenuItem.Name = "APAccountEnquiryToolStripMenuItem"
        Me.APAccountEnquiryToolStripMenuItem.Size = New System.Drawing.Size(275, 22)
        Me.APAccountEnquiryToolStripMenuItem.Text = "AP - Account Enquiry"
        '
        'APStatementOfAccountToolStripMenuItem1
        '
        Me.APStatementOfAccountToolStripMenuItem1.Name = "APStatementOfAccountToolStripMenuItem1"
        Me.APStatementOfAccountToolStripMenuItem1.Size = New System.Drawing.Size(275, 22)
        Me.APStatementOfAccountToolStripMenuItem1.Text = "AP - Statement of Account"
        '
        'APAgeingReportToolStripMenuItem1
        '
        Me.APAgeingReportToolStripMenuItem1.Name = "APAgeingReportToolStripMenuItem1"
        Me.APAgeingReportToolStripMenuItem1.Size = New System.Drawing.Size(275, 22)
        Me.APAgeingReportToolStripMenuItem1.Text = "AP - Ageing Report"
        '
        'APSubLedgerAccountEnquiryToolStripMenuItem1
        '
        Me.APSubLedgerAccountEnquiryToolStripMenuItem1.Name = "APSubLedgerAccountEnquiryToolStripMenuItem1"
        Me.APSubLedgerAccountEnquiryToolStripMenuItem1.Size = New System.Drawing.Size(275, 22)
        Me.APSubLedgerAccountEnquiryToolStripMenuItem1.Text = "AP - Sub Ledger Account Enquiry"
        '
        'FinancialReportsToolStripMenuItem
        '
        Me.FinancialReportsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.LedgerReportToolStripMenuItem, Me.TrialBalanceToolStripMenuItem, Me.ProfitAndLossStatementToolStripMenuItem, Me.BalanceToolStripMenuItem})
        Me.FinancialReportsToolStripMenuItem.Name = "FinancialReportsToolStripMenuItem"
        Me.FinancialReportsToolStripMenuItem.Size = New System.Drawing.Size(126, 22)
        Me.FinancialReportsToolStripMenuItem.Text = "Financial Reports"
        '
        'LedgerReportToolStripMenuItem
        '
        Me.LedgerReportToolStripMenuItem.Name = "LedgerReportToolStripMenuItem"
        Me.LedgerReportToolStripMenuItem.Size = New System.Drawing.Size(233, 22)
        Me.LedgerReportToolStripMenuItem.Text = "Ledger Report"
        '
        'TrialBalanceToolStripMenuItem
        '
        Me.TrialBalanceToolStripMenuItem.Name = "TrialBalanceToolStripMenuItem"
        Me.TrialBalanceToolStripMenuItem.Size = New System.Drawing.Size(233, 22)
        Me.TrialBalanceToolStripMenuItem.Text = "Trial Balance"
        '
        'ProfitAndLossStatementToolStripMenuItem
        '
        Me.ProfitAndLossStatementToolStripMenuItem.Name = "ProfitAndLossStatementToolStripMenuItem"
        Me.ProfitAndLossStatementToolStripMenuItem.Size = New System.Drawing.Size(233, 22)
        Me.ProfitAndLossStatementToolStripMenuItem.Text = "Profit and Loss Statement"
        '
        'BalanceToolStripMenuItem
        '
        Me.BalanceToolStripMenuItem.Name = "BalanceToolStripMenuItem"
        Me.BalanceToolStripMenuItem.Size = New System.Drawing.Size(233, 22)
        Me.BalanceToolStripMenuItem.Text = "Balance Sheet"
        '
        'frmGlMain
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
        Me.BackColor = System.Drawing.SystemColors.ActiveCaption
        Me.ClientSize = New System.Drawing.Size(1036, 473)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.MenuStrip1)
        Me.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.IsMdiContainer = True
        Me.MainMenuStrip = Me.MenuStrip1
        Me.MaximizeBox = False
        Me.Name = "frmGlMain"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "General Ledger"
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        Me.Panel1.ResumeLayout(False)
        Me.MenuStrip1.ResumeLayout(False)
        Me.MenuStrip1.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region
    Private Sub PosMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ValidUser = True
        LogFlag = 1

        If ValidUser = True Then
            Me.Text = Me.Text + " - " + CompanyName + " (User:" & UserName & "/" + CompanyTitle + "-" + LoginYear + ")"

        Else
            btnTrfr.Enabled = False
        End If

        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 40) = True Then
            FinancialReportsToolStripMenuItem.Enabled = True
        Else
            FinancialReportsToolStripMenuItem.Enabled = False
        End If

    End Sub

    Private Sub btnGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 55) = True Then
            Panel1.Controls.Clear()
            If GlgForm Is Nothing Then
                GlgForm = New frmLedgerGroupSearch
                GlgForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlgForm)
            GlgForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub
    Private Sub btnTrfr_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTrfr.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 58) = True Then
            Panel1.Controls.Clear()
            If GlrForm Is Nothing Then
                GlrForm = New frmGLRecurringAdd
                GlrForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlrForm)
            GlrForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing

    End Sub

    Private Sub PosMain_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        If Not PanelEmpty() Then
            MsgBox("Data exist in the form." & vbLf & "Settle/Void/Save", MsgBoxStyle.Information, "Inventory Manager")
            e.Cancel = True
        End If
    End Sub

    Private Function PanelEmpty() As Boolean
        PanelEmpty = True
    End Function

    Private Sub ChartOfAccountsToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChartOfAccountsToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 22) = True Then
            Panel1.Controls.Clear()
            If AccountForm Is Nothing Then
                AccountForm = New frmCOASearch
                AccountForm.MdiParent = Me
            End If
            Panel1.Controls.Add(AccountForm)
            AccountForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub DocumentsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DocumentsToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 19) = True Then
            Panel1.Controls.Clear()
            If GlgForm Is Nothing Then
                GlgForm = New frmLedgerGroupSearch
                GlgForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlgForm)
            GlgForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub BudgetToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BudgetToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 23) = True Then
            Panel1.Controls.Clear()
            If GlbForm Is Nothing Then
                GlbForm = New frmBudgets
                GlbForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlbForm)
            GlbForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub TransactionsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TransactionsToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 26) = True Then
            Panel1.Controls.Clear()
            If GltForm Is Nothing Then
                GltForm = New frmGLTransAdd
                GltForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GltForm)
            GltForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub ACEnquiryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ACEnquiryToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 29) = True Then
            Panel1.Controls.Clear()
            If GlEnqForm Is Nothing Then
                GlEnqForm = New frmGLLedgerEnquiry
                GlEnqForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlEnqForm)
            GlEnqForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub PointOfSaleEnquiryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PointOfSaleEnquiryToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 31) = True Then
            Panel1.Controls.Clear()
            If GLposForm Is Nothing Then

            End If
            'Panel1.Controls.Add(GLposForm)
            'GLposForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub TransactionEnquiryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TransactionEnquiryToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 30) = True Then
            Panel1.Controls.Clear()
            If GLtEnqForm Is Nothing Then
                GLtEnqForm = New frmGLTransEnquiry
                GLtEnqForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GLtEnqForm)
            GLtEnqForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub LedgerReportToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LedgerReportToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 41) = True Then
            Panel1.Controls.Clear()
            If GlslForm Is Nothing Then
                GlslForm = New frmLedgerReport
                GlslForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlslForm)
            GlslForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub TrialBalanceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrialBalanceToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 42) = True Then
            Panel1.Controls.Clear()
            If GlTbForm Is Nothing Then
                GlTbForm = New frmGLTrialBalance
                GlTbForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlTbForm)
            GlTbForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub ProfitAndLossStatementToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProfitAndLossStatementToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 43) = True Then
            Panel1.Controls.Clear()
            If GlPLForm Is Nothing Then
                GlPLForm = New frmGLProfitLossStatement
                GlPLForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlPLForm)
            GlPLForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub BalanceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BalanceToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 44) = True Then
            Panel1.Controls.Clear()
            If GlBsForm Is Nothing Then
                GlBsForm = New frmGLBalanceSheet
                GlBsForm.MdiParent = Me
            End If
            Panel1.Controls.Add(GlBsForm)
            GlBsForm.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim glgAdd As frmLedgerGroupAdd

    Private Sub AccountGroupCreateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AccountGroupCreateToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 17) = True Then
            glgAdd = New frmLedgerGroupAdd
            glgAdd.Show()
        Else
            MsgBox("Access Denied ", MsgBoxStyle.Critical, "Inventory Manager")
        End If
    End Sub

    Dim glaccAdd As frmGLAccountsAdd

    Private Sub ChartOfAccountsCreateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChartOfAccountsCreateToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 20) = True Then
            glaccAdd = New frmGLAccountsAdd
            glaccAdd.ShowDialog()
        Else
            MsgBox("Access Denied ", MsgBoxStyle.Critical, "Inventory Manager")
        End If
    End Sub
    Dim AR_argAdd As frmARgroupsAdd
    Dim AR_arcAdd As frmARcustomerAdd
    Dim CustGroupView As Object
    Dim CustMasterView As Object

    Private Sub CustomerGroupCreateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerGroupCreateToolStripMenuItem.Click

        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 5) = True Then
            Panel1.Controls.Clear()
            AR_argAdd = New frmARgroupsAdd
            AR_argAdd.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing

    End Sub

    Private Sub CustomerGroupViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerGroupViewToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 7) = True Then
            Panel1.Controls.Clear()
            If CustGroupView Is Nothing Then
                CustGroupView = New frmARgroups
                CustGroupView.MdiParent = Me
            End If
            Panel1.Controls.Add(CustGroupView)
            CustGroupView.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub CustomerMasterCreateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerMasterCreateToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 8) = True Then
            AR_arcAdd = New frmARcustomerAdd
            AR_arcAdd.ShowDialog()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
    End Sub

    Private Sub QToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 10) = True Then
            Panel1.Controls.Clear()
            If CustMasterView Is Nothing Then
                CustMasterView = New frmARcustomer
                CustMasterView.MdiParent = Me
            End If
            Panel1.Controls.Add(CustMasterView)
            CustMasterView.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub
    Dim ArEnq As frmARenquiry
    Dim ArStmt As frmARstatement

    Private Sub ARAccountEnquiryToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ARAccountEnquiryToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 32) = True Then
            Panel1.Controls.Clear()
            If ArEnq Is Nothing Then
                ArEnq = New frmARenquiry
                ArEnq.MdiParent = Me
            End If
            Panel1.Controls.Add(ArEnq)
            ArEnq.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub ARStatementOfAccountToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ARStatementOfAccountToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 33) = True Then
            Panel1.Controls.Clear()
            If ArStmt Is Nothing Then
                ArStmt = New frmARstatement
                ArStmt.MdiParent = Me
            End If
            Panel1.Controls.Add(ArStmt)
            ArStmt.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim ArAge As frmARageingReport
    Dim ArSL As frmARledgerReport

    Private Sub ARAgeingReportToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ARAgeingReportToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 35) = True Then
            Panel1.Controls.Clear()
            If ArAge Is Nothing Then
                ArAge = New frmARageingReport
                ArAge.MdiParent = Me
            End If
            Panel1.Controls.Add(ArAge)
            ArAge.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Private Sub ARSubLedgerAccountEnquiryToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ARSubLedgerAccountEnquiryToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 34) = True Then
            Panel1.Controls.Clear()
            If ArSL Is Nothing Then
                ArSL = New frmARledgerReport
                ArSL.MdiParent = Me
            End If
            Panel1.Controls.Add(ArSL)
            ArSL.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim budAdd As frmBudgetsAdd

    Private Sub BudgetViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BudgetViewToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 25) = True Then
            budAdd = New frmBudgetsAdd
            budAdd.ShowDialog()
        Else
            MsgBox("Access Denied ", MsgBoxStyle.Critical, "Inventory Manager")
        End If
    End Sub
    Dim argAdd As frmAPSupplierGroupAdd

    Private Sub SupplierGroupToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SupplierGroupToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 11) = True Then
            argAdd = New frmAPSupplierGroupAdd
            argAdd.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If

    End Sub
    Dim APgroupAdd As Object

    Private Sub SupplierGroupViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SupplierGroupViewToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 13) = True Then
            Panel1.Controls.Clear()
            If APgroupAdd Is Nothing Then
                APgroupAdd = New frmAPSupplierGroupView
                APgroupAdd.MdiParent = Me
            End If
            Panel1.Controls.Add(APgroupAdd)
            APgroupAdd.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim arcAdd As frmAPSupplierAdd

    Private Sub CreateSupplierToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CreateSupplierToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 14) = True Then
            arcAdd = New frmAPSupplierAdd
            arcAdd.ShowDialog()
        Else
            MsgBox("Access Denied ", MsgBoxStyle.Critical, "Inventory Manager")
        End If

    End Sub

    Dim APmasterView As Object
    Private Sub SupplierMasterViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SupplierMasterViewToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 16) = True Then
            Panel1.Controls.Clear()
            If APmasterView Is Nothing Then
                APmasterView = New frmAPSupplier
                APmasterView.MdiParent = Me
            End If
            Panel1.Controls.Add(APmasterView)
            APmasterView.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim APacEnq As Object
    Private Sub APAccountEnquiryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles APAccountEnquiryToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 36) = True Then
            Panel1.Controls.Clear()
            If APacEnq Is Nothing Then
                APacEnq = New frmAPEnquiry
                APacEnq.MdiParent = Me
            End If
            Panel1.Controls.Add(APacEnq)
            APacEnq.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim ApacStmt As Object

    Private Sub APStatementOfAccountToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles APStatementOfAccountToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 37) = True Then
            Panel1.Controls.Clear()
            If ApacStmt Is Nothing Then
                ApacStmt = New frmAPStatement
                ApacStmt.MdiParent = Me
            End If
            Panel1.Controls.Add(ApacStmt)
            ApacStmt.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim ApAgeRpt As Object
    Private Sub APAgeingReportToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles APAgeingReportToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 39) = True Then
            Panel1.Controls.Clear()
            If ApAgeRpt Is Nothing Then
                ApAgeRpt = New frmAPAgeingReport
                ApAgeRpt.MdiParent = Me
            End If
            Panel1.Controls.Add(ApAgeRpt)
            ApAgeRpt.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim ApSLRpt As Object

    Private Sub APSubLedgerAccountEnquiryToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles APSubLedgerAccountEnquiryToolStripMenuItem1.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 38) = True Then
            Panel1.Controls.Clear()
            If ApSLRpt Is Nothing Then
                ApSLRpt = New frmAPLedgerReport
                ApSLRpt.MdiParent = Me
            End If
            Panel1.Controls.Add(ApSLRpt)
            ApSLRpt.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If
        ApData = Nothing
    End Sub

    Dim dcTypeEdit As frmDocTypeView
    Dim docAdd As frmDocTypeAdd

    Private Sub ACDocumentsCreateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ACDocumentsCreateToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 46) = True Then
            docAdd = New frmDocTypeAdd
            docAdd.Show()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If

    End Sub

    Private Sub ACDocumentsViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ACDocumentsViewToolStripMenuItem.Click
        Dim ApData As New APdataLogic
        If ApData.IsValidUserOption(UserID, CompanyID, 45) = True Then
            dcTypeEdit = New frmDocTypeView
            dcTypeEdit.ShowDialog()
        Else
            MsgBox("Access Denied !", MsgBoxStyle.Critical, "Inventory Manager")
        End If

    End Sub
End Class
